package com.puzzlebazar.client.services;

import com.google.gwt.user.client.rpc.RemoteService;
import com.puzzlebazar.client.user.UserInfo;

public interface UserInfoService extends RemoteService {
	
	/**
	 * Login the current user and return its complete user information
	 * 
	 * @param email The e-mail of this user
	 * @return The complete user information, or null if loading failed
	 */
	public UserInfo loadUser(String email);

	/**
	 * Login the current user and return its complete user information
	 * 
	 * @return The complete user information of the current user, null if not logged on
	 */
	public UserInfo loadCurrentUser();

	/**
	 * Modifies a user given its information 
	 * 
	 * @param userInfo The complete user information (user id and username are ignored)
	 * @return UserInfo.ErrorFlags.SUCCESS if registration was successful, a combination of flags from UserInfo.ErrorFlags otherwise
	 */
	public int modifyUser(UserInfo userInfo);
}
